//
//  LineQuestionHeadView.m
//  ImGuider
//
//  Created by 王鹏宇 on 2017/8/18.
//  Copyright © 2017年 AudioCtrip. All rights reserved.
//

#import "LineQuestionHeadView.h"
#import "GuiderIconView.h"

@interface LineQuestionHeadView()

@property (nonatomic, strong) UILabel * lineNameLabel;

@property (nonatomic, strong) UILabel * guiderNameLabel;

@property (nonatomic, strong) GuiderIconView * guiderIconView;

@property (nonatomic, strong) UILabel * numLabel;
@end

@implementation LineQuestionHeadView

- (void)awakeFromNib {
    [super awakeFromNib];
    
    [self setup];
}


- (instancetype)init
{
    self = [super init];
    if (self) {
       [self setup];
    }
    return self;
}


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setup];
    }
    return self;
}


- (void)setup {
    
    _lineNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(17, 8, kScreenWidth - 34, 40)];
    _lineNameLabel.textColor = kTitleColor;//[UIColor whiteColor];
    _lineNameLabel.font = Font(17);
    _lineNameLabel.minimumScaleFactor = 0.9;
    _lineNameLabel.adjustsFontSizeToFitWidth = YES;
    
    _lineNameLabel.numberOfLines = 2;
    [self addSubview:_lineNameLabel];
    
    _guiderIconView = [[GuiderIconView alloc] initWithFrame:CGRectMake(17, 53, 32, 32)];
    _guiderIconView.borderColor = kContentColor;// [UIColor whiteColor];
    [self addSubview:_guiderIconView];
    _guiderNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(59, 53, kScreenWidth - 76, 32)];
    
    _guiderNameLabel.textColor = kTitleColor;// [UIColor whiteColor];
    _guiderNameLabel.font = Font(13);
    
    [self addSubview:_guiderNameLabel];
    
    _numLabel = [[UILabel alloc] initWithFrame:CGRectMake(17, 90, kScreenWidth - 34, 15)];
    _numLabel.font = Font(13);
    _numLabel.textColor = kContentColor;// [UIColor whiteColor];
    [self addSubview:_numLabel];
}


- (void)setLineName:(NSString *)lineName {
    
    _lineName = lineName;
    
    _lineNameLabel.text = lineName;
    
}

- (void) setGuiderName:(NSString *)guiderName {
    _guiderName = guiderName;
    
    _guiderNameLabel.text = guiderName;
}


- (void)setHeaderImageName:(NSString *)headerImageName {
    
    _guiderIconView.headerImageName = headerImageName;
}

- (void)setVip:(NSInteger)vip {
    
    _guiderIconView.vip = vip;
}

- (void)setNum:(NSInteger)num {
    _num = num;
    
    _numLabel.text = [NSString localizedStringWithFormat:MYLocalizedString(@"ASKED_COUNT", nil),@(num)];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
